package com.coupons;

import com.coupons.common.NetWorkUtil;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Toast;

public class Welcome extends Activity {
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,   
                WindowManager.LayoutParams.FLAG_FULLSCREEN);  
        requestWindowFeature(Window.FEATURE_NO_TITLE); 
        setContentView(R.layout.welcome);
        init();
        
    }
    public void init() {
    	checkNetWork();
    	finish();
    }
    
    private void checkNetWork() {
    	if (NetWorkUtil.isNetworkAvailable(this)) {
        	Intent intent = new Intent(this,CouponsActivity.class);
        	startActivity(intent);
        } else {
        	Toast.makeText(this, R.string.no_network, Toast.LENGTH_LONG).show();
        }
    }
    
}
